package com.web44.spring.service.impl;

import com.web44.spring.service.IUserBookAllService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Title: UserBookAllService
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/11 10:14
 */
@Service
public class UserBookAllService implements IUserBookAllService {

    @Autowired
    private UserBookService userBookService;

    @Override
    // @Transactional
    public void buyAll(List<Integer> userIds, int bookId) {
        for(int i = 0;i<userIds.size();i++) {
            int userId = userIds.get(i);
            userBookService.buy(userId,bookId);
        }

    }
}
